
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title></title>
		
		<!-- 全局css引入 必须 -->
		<link href="<%=basePath%>/style/style.css" rel="stylesheet"
			type="text/css">
		<link href="<%=basePath%>/style/global.css" rel="stylesheet"
			type="text/css">
		<!-- 结束 -->
		<!-- 用到表单验证必须引入 -->
		<jsp:include page="/vailidateInclude.jsp" />
		<!-- 结束 -->
		<script type="text/javascript" src='dwr/interface/Tools.js'></script>
		<script type="text/javascript" src='dwr/engine.js'></script>
		<script type="text/javascript" src='dwr/util.js'></script>
		<jsp:include page="/jqueryInclude.jsp" />
		<script type="text/javascript">
			function xiaoshu(){//0-9�͡�.
				if(window.event.keyCode>57||window.event.keyCode<48 && window.event.keyCode != 46){
					window.event.keyCode = 0;
				}
			}
			function sub(){
				var id = $("#id").val();
				var s = $("#code");
				if(s.value == ""){
					return;
				}
				if(id == ""||id==null){
					id="0";
				}
				var sql = "select count(1) from dic where code='" +$.trim(s.val()) +"' and id!=" + id;
				DWREngine.setAsync(false);
				Tools.getInt(sql,function(data){
					if(data > 0||s.value=="-1"){
						$("#cc").html("该字典编码已存在");
					}else{
						$("#cc").fadeOut(1000);
					}
				});
				
			}
		
		</script>
			
	</head>
	<body>
		<div class="rightCon" align="center">
			<div class="rightTitle2">
				<h3>
					<s:property value="nav" escape="false"/>
				</h3>
			</div>
			<s:form action="saveSecondDic.do" method="post" cssClass="required-validate" onsubmit="return sub()">
				<table class="formTable">
					<tr class="formTr">
					<s:hidden name="dic.id" id="id"></s:hidden>
					
						<td align="right" width="20%" class="formLabel">
							字典代码<input type="hidden" name="dic.pcode" value="${dic.pcode}">
							<!-- CODE -->
							：
						</td>
						<td align="left" width="20%">
							<s:textfield name="dic.code" id="code" cssClass="required" onblur="return sub()"></s:textfield><br>
							<font id="cc"  color="red" style="font-weight: bolder;"></font>
						</td>
						<td align="right" width="20%" class="formLabel">
							字典值
							<!-- VALUE -->
							：
						</td>
						<td align="left" width="20%">
							<s:textfield name="dic.value" id="" cssClass="required"></s:textfield>
						</td>
					</tr>
					<tr class="formTr">
						<td align="right" width="20%" class="formLabel">
							最小值
							<!-- MIN -->
							：
						</td>
						<td align="left" width="20%">
							<s:textfield name="dic.min" id=""></s:textfield>
						</td>
						<td align="right" width="20%" class="formLabel">
							最大值
							<!-- MAX -->
							：
						</td>
						<td align="left" width="40%">
							<s:textfield name="dic.max"></s:textfield>
						</td>
					</tr>
					<tr class="formTr">
						<td align="right" width="20%" class="formLabel">
							排序
							<!-- PAIXU -->
							：
						</td>
						<td align="left" width="20%">
							<s:textfield name="dic.paixu" id="" ></s:textfield>
						</td>
						<td align="right" width="20%" class="formLabel">
							备注
							<!-- NOTE -->
							：
						</td>
						<td align="left" width="40%">
							<s:textfield name="dic.note" id="" ></s:textfield>
						</td>
					</tr>
				</table>
				<table class="form_submit_bar">
					<tr>
						<td width="30%" align="center" colspan="4">
							<input class="buttonSearch" id="button2" type="submit" value="保存" />
							&nbsp;&nbsp;&nbsp;&nbsp;
							<input class="buttonSearch" id="button2" type="reset" value="重置" />
						</td>
					</tr>
				</table>
			</s:form>
	</body>
</html>